home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2002 #4 / K-CD-4-2002.ISO / Empire Earth / EEDemo.exe / Disk1 / data.ssa / unit ai scripts_generic air attack.tai < prev    next >
Encoding:
Text File  |  2001-09-29  |  4.2 KB  |  144 lines

  1. //
  2. // Generic Air Attack unit AI file
  3. //
  4. // Behaviors:
  5. //
  6. //        Handles attack ai for aircraft.
  7. //
  8. //    Notes:
  9. //
  10. //    Known Problems:
  11. //
  12.  
  13. Fly
  14. {
  15.     EnemyUnitMoved true(CheckRange)
  16.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  17.     allof(GoalIsLocation,AttackMoveEnabled,EnemyUnitSpotted) true(CheckRange)
  18.     allof(CanITargetEnemies,GoalIsNotPlayerInitiated,EnemyUnitSpotted) true(CheckRange)
  19.     anyof(EnemyUnitDestroyed,CeaseFire) true(SearchForSecondaryTarget)
  20.     allof(GoalIsUnit,UnitInWeaponRange) true(FaceEnemyUnit)
  21.     allof(GoalIsAttackLocation,LocationInWeaponRange) true(FaceLocation)
  22. }
  23.  
  24. ContinueToFly
  25. {
  26.     EnemyUnitMoved true(CheckRange)
  27.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  28.     allof(GoalIsLocation,AttackMoveEnabled,EnemyUnitSpotted) true(CheckRange)
  29.     allof(CanITargetEnemies,GoalIsNotPlayerInitiated,EnemyUnitSpotted) true(CheckRange)
  30.     allof(GoalIsAttackLocation,LocationInWeaponRange) true(FaceLocation)
  31.     allof(GoalIsUnit,UnitInWeaponRange) true(FaceEnemyUnit)
  32. }
  33.  
  34. Circle
  35. {
  36.     allof(GoalIsAttackLocation,LocationInWeaponRange) true(FaceLocation)
  37.     allof(CanITargetEnemies,EnemyUnitSpotted) true(CheckRange)
  38.     AmIUnderAttack true(UnderAttack)
  39. }
  40.  
  41. CheckRange
  42. {
  43.     anyof(EnemyUnitDestroyed,CeaseFire,UnitNotOnMap) true(ShouldIReturnToInitialContactLocation)
  44.     allof(GoalIsUnit,UnitInWeaponRange) true(FaceEnemyUnit) 
  45.     allof(GoalIsAttackLocation,LocationInWeaponRange) true(FaceEnemyUnit) false(ShouldIFollowEnemyUnit)
  46. }
  47.  
  48. ShouldIFollowEnemyUnit
  49. {
  50.     GoalIsPlayerInitiated true(FaceEnemyUnit)
  51.     anyof(CanIPursuePastInitialContactLOS,EnemyInsideInitialContactLOS) true(FaceEnemyUnit) false(ShouldIReturnToInitialContactLocation)
  52. }
  53.  
  54. ShouldIReturnToInitialContactLocation
  55. {
  56.     allof(HasValidInitialContactLocation,ReturnsToInitialContactLocation,GoalIsNotPlayerInitiated) true(ReturnToInitialContactLocation) false(Circle)
  57. }
  58.  
  59. ReturnToInitialContactLocation
  60. {
  61.     AlwaysTrue true(PrepareToMove)
  62. }
  63.  
  64. PrepareToMove
  65. {
  66.     anyof(EnemyUnitDestroyed,CeaseFire) true(SearchForSecondaryTarget)
  67.     allof(GoalIsUnit,UnitInWeaponRange) true(FaceEnemyUnit)
  68.     allof(GoalIsAttackLocation,LocationInWeaponRange) true(FaceLocation)
  69. }
  70.  
  71. FaceEnemyUnit
  72. {
  73.     FlightTimeAlarm true(RequestLanding)
  74.     allof(LocationOffMap,LocationWayOffMap) true(MoveToValidMapLocation)
  75.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  76.     anyof(EnemyUnitDestroyed,UnitNotOnMap) true(SearchForSecondaryTarget)
  77.     UnitInWeaponRange false(PrepareToMove)
  78.     allof(Reloaded,EnemyUnitInsideFiringArch) true(AttackEnemyUnit)
  79. }
  80.  
  81. FaceLocation
  82. {
  83.     FlightTimeAlarm true(RequestLanding)
  84.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  85.     LocationInWeaponRange false(PrepareToMove)
  86.     allof(Reloaded,LocationInsideFiringArch) true(AttackLocation)
  87. }
  88.  
  89. AttackEnemyUnit
  90. {
  91.     FlightTimeAlarm true(RequestLanding)
  92.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  93.     anyof(EnemyUnitDestroyed,CeaseFire,UnitNotOnMap) true(SearchForSecondaryTarget)
  94.     allof(GoalIsUnit,UnitInWeaponRange) false(PrepareToMove)
  95.     EnemyUnitInsideFiringArch false(FaceEnemyUnit)
  96.     ArrivedAtMoveWaypoint true(PrepareToMove)
  97.     AlwaysTrue true(WaitForReload)
  98. }
  99.  
  100. AttackLocation
  101. {
  102.     FlightTimeAlarm true(RequestLanding)
  103.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  104.     CeaseFire true(Circle)
  105.     LocationInsideFiringArch false(FaceLocation)
  106.     AlwaysTrue true(WaitForReload)
  107. }
  108.  
  109. WaitForReload
  110. {
  111.     FlightTimeAlarm true(RequestLanding)
  112.     allof(AmIUnderAttack,GoalIsNotPlayerInitiated,CanFlee) true(RunFromAttacker)
  113.     allof(GoalIsUnit,Reloaded) true(FaceEnemyUnit)
  114.     allof(GoalIsAttackLocation,Reloaded) true(FaceLocation)
  115. }
  116.  
  117. InitialAttackState
  118. {
  119.     //Reloaded false(WaitForReload)
  120.     GoalIsUnit true(FaceEnemyUnit)
  121.     GoalIsAttackLocation true(FaceLocation)
  122. }
  123.  
  124. SearchForSecondaryTarget
  125. {
  126.     allof(CanITargetEnemies,SecondaryTargetFound) true(FaceEnemyUnit) false(ShouldIReturnToInitialContactLocation)
  127. }
  128.  
  129. RetaliateAgainstAttacker
  130. {
  131.     AlwaysTrue true(CheckRange)
  132. }
  133.  
  134. RunFromAttacker
  135. {
  136.     AlwaysTrue true(PrepareToMove)
  137. }
  138.  
  139. UnderAttack
  140. {
  141.     CanFlee true(RunFromAttacker) 
  142.     allof(CanITargetEnemies,IsAttackerInRetaliationRange,CanDamageAttacker) true(RetaliateAgainstAttacker) false(RunFromAttacker)
  143. }
  144.